﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RadarGlobalPro.Class
{
    public class GroupItem
    {
        public int Id { set; get; }
        public string Title { set; get; }
        public string Owner { get; set; }
        public int MyOwner { get; set; }
        public int TagType { get; set; }
        public int Status { get; set; }

        public static List<GroupItem> DeserializeObject(List<List<string>> data,int TagType=0)
        {
            List<GroupItem> result = new List<GroupItem>();

            foreach (List<string> items in data)
            {
                if (items.Count >= 5)
                {
                    GroupItem item = new GroupItem()
                    {
                        Id = int.Parse(items[0]),
                        Title = items[1],
                        Owner = items[2],
                        MyOwner = int.Parse(items[3]),
                        Status = int.Parse(items[4]),
                        TagType=TagType
                    };
                    result.Add(item);
                }
            }
            return result;
        }
    }
}
